package com.reebake.ideal.storage.controller;

import cn.hutool.core.bean.BeanUtil;
import com.reebake.ideal.storage.service.FileDetailService;
import com.reebake.ideal.storage.vo.FileDetailVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("file/detail")
@RequiredArgsConstructor
public class FileDetailPlusController {
    private final FileDetailService fileDetailService;

    @GetMapping("query-by-id/{fileDetailId}")
    public FileDetailVO queryById(@PathVariable String fileDetailId){
        return BeanUtil.copyProperties(fileDetailService.getById(fileDetailId), FileDetailVO.class);
    }
}
